/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tkatva.soalog.manBeans;

import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.ejb.EJB;
import tkatva.soalog.SoalogEjb.entities.*;
import tkatva.soalog.SoalogEjb.dao.*;
/**
 *
 * @author iMac
 */
@ManagedBean
@ViewScoped
public class MainViewBean {

    
    
    @EJB 
    SoalogDaoLocal soaDao;
    
    private String selectedEnvironment;
    private String[] envs = {"DEV","TEST","PROD"};
    List<LogInterface> foundInterfaces;

    
    public MainViewBean() {
    }
    
    public void loadInterfacesWithEnv() {
        if (this.selectedEnvironment != null && this.selectedEnvironment.length() > 1) {
            this.foundInterfaces = soaDao.getAllLogInterfacesWithEnv(this.selectedEnvironment.trim());
        }
    }
    
    
    public String[] getEnvs() {
        return envs;
    }

    public void setEnvs(String[] envs) {
        this.envs = envs;
    }

    public String getSelectedEnvironment() {
        return selectedEnvironment;
    }

    public void setSelectedEnvironment(String selectedEnvironment) {
        this.selectedEnvironment = selectedEnvironment;
    }
    
    public List<LogInterface> getFoundInterfaces() {
        return foundInterfaces;
    }

    public void setFoundInterfaces(List<LogInterface> foundInterfaces) {
        this.foundInterfaces = foundInterfaces;
    }
    
    
}
